package com.common;

import cn.dev33.satoken.stp.StpUtil;

import java.util.Arrays;
import java.util.List;

public class Constants {
    public static final String DEFAULT_SUCCESS_MESSAGE = "success";
    public static final String DEFAULT_NULL_MESSAGE = "数据为空";
    public static final String DEFAULT_FAILURE_MESSAGE = "error";
    //密码加密的公钥和私钥：一旦项目上线不可变更
    public static final String USER_PASSWORD_PRIVATE_KEY ="MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJNV9Xc6c8FdZ59oC1YVh5T1bXxPn5YuU8LsGWwd1BxfnFQRQvR87TTawpEuxrIfNPgJWxhLUsAVnV+zBZ1J+lkZKJSPaWK0IhYVdw8cIPMZKLi+JKBSApkTSzOCtMACBhkaV6QeVPyigK9jwlvXBebPxRb1o7EceMankwhFfFCRAgMBAAECgYBcNHFX2lbS7leJJR3jE7oz+Jw6LcJbxEZbOFJ4nPo/f35gBiV2yC/S4gzduv5SPsFxcLl3rLvuxhgk6e5bjw6CfN/j2ZEBBkOUNPgzZ6EWTJYzVi5X5vsrDK10QLAroyMpvpdO52G6FAWIeekvRqa8cQKRD3NqqSggGuimopKgAQJBAMYwwy//X9r1si02C8MREGoH0g0jIC4H/cTqeK0K9TbeRdxAZ5zV7SgCna//4mUy+5QCAnYWgo8H4UXtXy8BvwECQQC+T8jsvCYua3RFDdc4Oi4fyhQd3UXVicSKTuXDvyl16bbLSRlJFErG4bWtTstjOwZZaqigutIrs9MsiZNL4CGRAkAr7AqVzIa1w9Wk52Fb7aAxn2IRv0MWcHbw+PWdg9wsOL5KvYs42sAgKdRAePj3bIEMoBVjjkGI6TongR+jD0QBAkBdXZcdTVEOBPmNxzSHCUQHpIQqApx4Hpalo/9lASu+BWMAaGRXTfVBjQosdDOkAxkiVQlVkVH6zsYTW4s/9j2BAkEAkux61czreLaAffPk6QAJj1YIUkTKa6jMoe3wGRHkJyaq+ejWgD5kKCXk0k1M9pUKij8WgGtpMCf/schGKQrs1A==";
    public static final String USER_PASSWORD_PUBLIC_KEY ="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCTVfV3OnPBXWefaAtWFYeU9W18T5+WLlPC7BlsHdQcX5xUEUL0fO002sKRLsayHzT4CVsYS1LAFZ1fswWdSfpZGSiUj2litCIWFXcPHCDzGSi4viSgUgKZE0szgrTAAgYZGlekHlT8ooCvY8Jb1wXmz8UW9aOxHHjGp5MIRXxQkQIDAQAB";
    //登录用户的Redis前缀
    public static final String LOGIN_USER_PREFIX_KEY = "Login:users:";
    //Token前缀
    public static final String LOGIN_TOKEN_PREFIX_KEY = StpUtil.getTokenName()+":login:token:";
    //时间处理
    //默认日期时间格式
    public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
    //默认日期格式
    public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
    //默认时间格式
    public static final String DEFAULT_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
    //登录用户名正则表达式
    public static final String VALID_PHONE_PATTERN = "^1(3\\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$";
    public static final String VALID_EMAIL_PATTERN = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$";
    public static final String VALID_PASSWORD_PATTERN = "^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,20}$";
    public static final String DEFAULT_USERNAME_MESSAGE = "username format error";
    public static final String DEFAULT_PASSWORD_MESSAGE = "password format error";
    public static final String DEFAULT_PHONE_MESSAGE = "phone format error";
    //枚举类型校验
    public static final String DEFAULT_ENUM_MESSAGE = "value not in range";
    //默认用户角色码
    public static final String DEFAULT_ROLE_CODE = "default";
    public static final String DEFAULT_ADMIN_ROLE_CODE = "admin";
    public static final String WEB_STATIC_PREFIX = "/static/";

    public static final List<String> IMAGE_SUFFIX = Arrays.asList("jpg","jpeg","png","bmp","gif");
    public static final List<String> SYLLABUS_SUFFIX = Arrays.asList("pdf","doc","docx");
}
